package com.ruoyi.business.service.impl;

import cn.hutool.core.bean.BeanUtil;
import com.ruoyi.business.mapper.BedsPlusMapper;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.core.domain.PageQuery;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ruoyi.business.domain.HisGuest;
import com.ruoyi.business.mapper.HisGuestMapper;
import com.ruoyi.business.service.IHisGuestService;

import java.util.List;
import java.util.Map;
import java.util.Collection;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
 * 招待所使用记录Service业务层处理
 *
 * @author songzhengsheng
 * @date 2023-07-04
 */
@RequiredArgsConstructor
@Service
public class HisGuestServiceImpl  extends ServiceImpl<HisGuestMapper, HisGuest> implements IHisGuestService {

    @Autowired
    private HisGuestMapper hisGuestMapper;
    @Override
    public LambdaQueryWrapper<HisGuest> buildQueryWrapper(HisGuest bo) {
        LambdaQueryWrapper<HisGuest> lqw = Wrappers.lambdaQuery();
                    lqw.eq(bo.getDormitoryid()!=null, HisGuest::getDormitoryid, bo.getDormitoryid());
                    lqw.eq(StringUtils.isNotBlank(bo.getApplicant()), HisGuest::getApplicant, bo.getApplicant());
                    lqw.eq(StringUtils.isNotBlank(bo.getTenant()), HisGuest::getTenant, bo.getTenant());
                    lqw.eq(bo.getCheckin() != null, HisGuest::getCheckin, bo.getCheckin());
                    lqw.eq(bo.getExpectedusedays() != null, HisGuest::getExpectedusedays, bo.getExpectedusedays());
                    lqw.eq(bo.getCheckout() != null, HisGuest::getCheckout, bo.getCheckout());
                    lqw.eq(StringUtils.isNotBlank(bo.getLeader()), HisGuest::getLeader, bo.getLeader());
                    lqw.eq(StringUtils.isNotBlank(bo.getKeyrecipient()), HisGuest::getKeyrecipient, bo.getKeyrecipient());
                    lqw.eq(StringUtils.isNotBlank(bo.getKeyrecipienttel()), HisGuest::getKeyrecipienttel, bo.getKeyrecipienttel());
                    lqw.eq(StringUtils.isNotBlank(bo.getActualperson()), HisGuest::getActualperson, bo.getActualperson());
                    lqw.eq(StringUtils.isNotBlank(bo.getActualpersontel()), HisGuest::getActualpersontel, bo.getActualpersontel());
        return lqw;
    }

    @Override
    public List<HisGuest> getlist() {
        return hisGuestMapper.getlist();
    }

}
